<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登入 - 长信安昌</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/plugin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/plugin/layui/admin.css" media="all">
    <link rel="stylesheet" href="/static/plugin/layui/login.css" media="all">
</head>
<body style="background-color:#FFE4E1;">

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>长信安昌</h2>
            <p>长信包装计件计费系统-后台财务</p>
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                <input type="text" name="username" id="username" required placeholder="用户名" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                <input type="password" name="password" id="password" required placeholder="密码" class="layui-input">
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid" id="login_btn">登 入</button>
            </div>
        </div>
    </div>

    <div class="layui-trans layadmin-user-login-footer">
        <p>©2020 <a href="http://api.cxacjk.com/" target="_blank">长信安昌</a> <a href="http://www.beian.gov.cn/portal/index.do" target="_blank">皖ICP备20010393号</a></p>
    </div>
</div>
<script src="/static/js/public/jquery-1.10.2.min.js"></script>
<script src="/static/js/public/jquery.form.js"></script>
<script src="/static/js/public/bootstrap.min.js"></script>
<script src="/static/js/public/modernizr.min.js"></script>
<script src="/static/js/public/layer.js"></script>
<script src="/static/plugin/layui/layui.js"></script>
<script>
    var submit_url = "{:url('admin/Index/checkLogin')}";
    var index_url = "{:url('admin/Home/index')}";
    // 登录验证
    $("#login_btn").click(function(){
        var username = $('#username').val();
        var password = $('#password').val();
        if (!username) {return layer.msg('请输入用户账号') }
        if (!password) {return layer.msg('请输入用户密码') }
        $.post(submit_url, {username: username, password: password}, function(data){
            layer.msg(data.msg)
            if(data.status === 1){
                setTimeout(function(){
                    window.location.href = index_url
                }, 1000)
            }
        })
    });
</script>
</body>
</html>
